
Imports System.Data.OracleClient
Namespace persistent
    Public Class RealRunControl5

        Public Shared Function GetHandsetServices(ByVal co_id As String) As DataTable
            Dim con As New OracleConnection(ConfigurationSettings.AppSettings("OraConnStr"))
            con.Open()
            Dim cmd As New OracleCommand
            cmd.Connection = con
            cmd.CommandText = "EU_BILL.PKG_HANDSET_CUSTOMIZATION.get_ghh_handset_services"
            cmd.CommandType = CommandType.StoredProcedure

            cmd.Parameters.Add("p_co_id", OracleType.Int32).Value = co_id
            cmd.Parameters.Add("p_cursor", OracleType.Cursor).Direction = ParameterDirection.Output

            Dim rdr As OracleDataReader
            rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

            Dim dt As New DataTable


            dt.Columns.Add("co_id")
            dt.Columns.Add("sncode")
            dt.Columns.Add("cs_stat_chng")
            dt.Columns.Add("des")
            dt.Columns.Add("subscription_id")

            Dim str(4) As String

            While rdr.Read
                str(0) = rdr.Item(0)
                str(1) = rdr.Item(1)
                str(2) = rdr.Item(2)
                str(3) = rdr.Item(3)
                If Not rdr.Item(4) Is DBNull.Value Then
                    str(4) = rdr.Item(4)
                Else
                    str(4) = "0"
                End If

                dt.Rows.Add(str)
            End While

            Return dt
            con.Close()

        End Function

    End Class
End Namespace